#include "cpu/exec/template-start.h"

#define instr lgdt 

static void do_execute() { 
    //printf("lgdt:eip:0x%x\n",cpu.eip);
    //Assert(0,"?\n");
    //printf("src:0x%x\n",op_src->addr);
    //读GDTR的limit部分(16位)
    cpu.gdtr.limit = swaddr_read(op_src->addr,2);
    //读GDTR的base部分：
    //若操作数16位，则所读base为24位，
    //若操作数为32位，则所读base为32位
	if (op_src->size == 2){  //m16:24
		cpu.gdtr.base = swaddr_read(op_src->addr + 2,3);//24 bit
	}
    else if (op_src->size == 4){  //m32:32
		cpu.gdtr.base = swaddr_read(op_src->addr + 2,4);//32 bit
	}
	print_asm_template1();
}

make_instr_helper(rm)

#include "cpu/exec/template-end.h"